Field of the Invention
The present invention relates to dynamic compilation.
Description of the Related Art
Conventionally, in a virtual machine environment as a program execution environment, there is known a means called JIT (Just In Time) compilation, which performs compilation of native codes during execution of an application. JIT compilation preferentially converts functions with large call counts into native codes during execution of a program. Literatures disclosing such a technique include Japanese Patent No. 5167589. In addition, native codes are temporarily saved in a memory area called a code cache. When the code cache becomes full, native codes are sequentially discarded from the code cache in ascending order of execution frequency.
If no native code is generated, an application is executed in an interpreter scheme. The execution speed in the interpreter scheme is lower than when the application is executed by native codes. Note that since native codes are generated during execution of an application, a high-speed operation using native codes cannot be performed in the initial use of the application. As a technique for solving this problem, there is known a conventional technique of loading an application and completing JIT compilation in advance before the user executes the application. See, for example, “Summary of JIT Compilation and Optimization”.
However, all the functions called by an application loaded in advance by the conventional technique are not always required in practice. If, for example, the user uses only some functions of an application, some functions are not called. JIT compilation is not required for such functions.
Assume that after the native code of a given function F saved in a code cache is discarded, the function F is called again. In this case, compilation is sometimes performed again. In such a case, the same native code as that generated before is generated again. This can be regarded as a wasteful operation.